<?php
/**
 * Created by PHPStorm
 * User: xieshentao
 * Date: 2021/4/1
 * Email: <939369942@qq.com>
 */

namespace basic\services;
use edward\captcha\facade\CaptchaApi;

/**
 * api验证码
 * Class ApiCodeService
 * @package basic\services
 */
class CaptchaService
{
    /**
     * Notes:
     * @param false $show_code
     * @return array|object
     * @Author: xiest
     * @Date: 2021/4/1 14:04
     */
    public static function create($show_code = false)
    {
        $data = CaptchaApi::create();
        if(!$show_code) unset($data['code']);
        return $data;
    }

    /**
     * Notes:
     * @param $code
     * @param $key
     * @return bool
     * @Author: xiest
     * @Date: 2021/4/1 14:04
     */
    public static function check($code,$key)
    {
        return CaptchaApi::check($code,$key);
    }


}